package com.voxel.sense.infomsg.module.wifi;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;

import com.example.com.common.app.BViewActivity;
import com.example.com.common.view.recycler.RecyclerAdapter;
import com.voxel.sense.infomsg.R;
import com.voxel.sense.infomsg.module.task.manager.TaskManagerActivity;
import com.voxel.sense.infomsg.view.titlebar.TextTitleBar;

import java.util.List;

import butterknife.BindView;
import cyy.example.com.facotry.model.api.response.WifiWarnBean;


public class WifiWarnActivity extends BViewActivity<WifiWarnContract.Presenter> implements WifiWarnContract.View{

    @BindView(R.id.titlebar)
    TextTitleBar titleBar;

    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    private WifiWarnAdapter wifiWarnAdapter;

    @Override
    protected WifiWarnPresenter initPresenter() {
        return new WifiWarnPresenter(this);
    }

    @Override
    protected int getContentLayoutId() {
        return R.layout.activity_wifi_warn;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    public static void show(Context context) {
        context.startActivity(new Intent(context, WifiWarnActivity.class));
    }

    private void initView() {
        titleBar.setTitleText("断网警告");
        mPresenter.getWifiWarnList(1, 1000);
        wifiWarnAdapter = new WifiWarnAdapter();
        recyclerView.setAdapter(wifiWarnAdapter);
    }

    @Override
    public void showList(List<WifiWarnBean> data) {
        wifiWarnAdapter.setData(data);
    }

}
